package org.liushao.service.impl;

import org.liushao.dao.AccountDao;
import org.liushao.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @program: untitled
 * @ClassName AccountServiceImpl
 * @description:
 * @author: 刘庆东
 * @create: 2024−11-28 14:09
 * @Version 1.0
 **/
@Service
public class AccountServiceImpl  implements AccountService {

    @Autowired
    private AccountDao accountDao;

    @Override
   // @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    public void accountMoney() {
        //tiger减少
        accountDao.reduceMoney();
           System.out.println(1/0);//故意制造异常
        accountDao.addMoney();

    }
}
